package com.huashi.dealer.modular.business.order.param;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.util.List;

/**
 * 订单发货参数
 *
 * @author 谭陈强
 * @since 2025-08-15
 */
@Data
@Schema(description = "订单发货参数")
public class OrderDeliveryParam {

    @Schema(description = "物流公司ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "物流公司不能为空")
    private Long expressId;

    @Schema(description = "物流单号", example = "SF1234567890", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "物流单号不能为空")
    private String expressNo;

    @Schema(description = "发货商品信息")
    private List<DeliveryGoodsParam> goods;

    @Schema(description = "发货备注", example = "请及时签收")
    private String remark;

    /**
     * 发货商品参数
     */
    @Data
    @Schema(description = "发货商品参数")
    public static class DeliveryGoodsParam {

        @Schema(description = "商品ID", example = "1001", requiredMode = Schema.RequiredMode.REQUIRED)
        @NotNull(message = "商品ID不能为空")
        private Long goodsId;

        @Schema(description = "发货数量", example = "1", requiredMode = Schema.RequiredMode.REQUIRED)
        @NotNull(message = "发货数量不能为空")
        private Integer quantity;

        @Schema(description = "物流图片", example = "[\"image1.jpg\", \"image2.jpg\"]")
        private List<String> images;
    }
}
